/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.hazard.source.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.bizz.common.core.util.DateUtils;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 重大危险源评价报告
 *
 * @author daijie
 * @date 2023-11-06 11:31:29
 */
@Data
@TableName("haz_evaluation_report")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "重大危险源评价报告")
public class HazEvaluationReportEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 危险源标识
     */
    @Schema(description = "危险源标识")
    private Long hazardSourceId;

    /**
     * 报告类型
     */
    @Schema(description = "报告类型")
    private String hazardReportType;

    /**
     * SIL等级
     */
    @Schema(description = "SIL等级")
    private String silLevel;

    /**
     * 报告名称
     */
    @Schema(description = "报告名称")
    private String name;

    /**
     * 评估日期
     */
    @Schema(description = "评估日期")
    private Date evaluationDate;

    /**
     * 有效期
     */
    @Schema(description = "有效期")
    private Date validityDate;

    /**
     * 文件
     */
    @Schema(description = "文件")
    private String files;

    /**
     * 状态
     */
    @Schema(description = "状态")
    private String status;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getValidityDateStr() {
        return DateUtils.limitDay(this.validityDate);
    }

    public String getEvaluationDateStr() {
        return DateUtils.limitDay(this.evaluationDate);
    }

    public String getStatusStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.hazard_report_status, this.status);
    }

    public String getHazardReportTypeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.hazard_report_type, this.hazardReportType);
    }

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
    }

    public String getHazardSourceIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.hazard_source, this.hazardSourceId);
    }
}
